﻿/***************************************************************************
 创建者: 华磊
 开始时间: 2019.9.20
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) 姓名 2019.9.20 类的具体实现代码编写

 ***************************************************************************
 *  @file x.h
 *  功能:
 *
 *
 ***************************************************************************/
#ifndef MONITORMAPITEMBKG_H
#define MONITORMAPITEMBKG_H

#include <QGraphicsObject>
#include "onemap.h"

class MonitorMapItemBkg : public QGraphicsObject
{
    Q_OBJECT
public:
    MonitorMapItemBkg(MapBackground *_bkg, QGraphicsItem *parent = nullptr);
    enum { Type = UserType + 26 };
    int type() const
    {
        // Enable the use of qgraphicsitem_cast with this item.
        return Type;
    }
    QRectF boundingRect() const override;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) override;

    MapBackground *getBkg(){return bkg;}

    void setBkg(MapBackground *_bkg){
        bkg = _bkg;
        emit sig_positionChange(bkg);
    }

    void my_update();
protected:
    QVariant itemChange(GraphicsItemChange change, const QVariant &value);

signals:
    void sig_positionChange(MapSpirit *);
public slots:

private:
    MapBackground *bkg;
    QImage img;
};

#endif // MONITORMAPITEMBKG_H
